<!DOCTYPE html>
<html lang="en">

<!-- Head tag -->
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!--Description-->
    
        <meta name="description" content="后台管理系统(后台是php)1，登录问题，路由功能，首先要求登录，无论是什么url地址,先登录由后台实现，隐藏index.php文件跨域错误,配置反向代理httpd-vhost.conf   ProxyPass 地址登录按钮是submit,点击时阻止默认跳转，cookie记录用户信息  实现信息共享">
    

    <!--Author-->
    
        <meta name="author" content="John Doe">
    

    <!--Open Graph Title-->
    
        <meta property="og:title" content="项目bug"/>
    

    <!--Open Graph Description-->
    

    <!--Open Graph Site Name-->
    <meta property="og:site_name" content="Hexo"/>

    <!--Type page-->
    
        <meta property="og:type" content="article" />
    

    <!--Page Cover-->
    

        <meta name="twitter:card" content="summary" />
    

    <!-- Title -->
    
    <title>项目bug - Hexo</title>

    <!-- Bootstrap Core CSS -->
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>

    <!-- Custom CSS -->
    <link rel="stylesheet" href="/css/style.css">

    <!-- Custom Fonts -->
    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" type="text/css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Gallery -->
    <link href="//cdnjs.cloudflare.com/ajax/libs/featherlight/1.3.5/featherlight.min.css" type="text/css" rel="stylesheet" />

    <!-- Google Analytics -->
    


    <!-- favicon -->
    
	
</head>


<body>

    <!-- Menu -->
    <!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header page-scroll">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">逐风</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                
                    <li>
                        <a href="/">
                            
                                Home
                            
                        </a>
                    </li>
                
                    <li>
                        <a href="/archives">
                            
                                Archives
                            
                        </a>
                    </li>
                
                    <li>
                        <a href="/tags">
                            
                                Tags
                            
                        </a>
                    </li>
                
                    <li>
                        <a href="/categories">
                            
                                Categories
                            
                        </a>
                    </li>
                
                    <li>
                        <a href="https://github.com/klugjo/hexo-theme-clean-blog">
                            
                                <i class="fa fa-github fa-stack-2x"></i>
                            
                        </a>
                    </li>
                
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>

    <!-- Main Content -->
    <!-- Page Header -->
<!-- Set your background image for this header in your post front-matter: cover -->

<header class="intro-header" style="background-image: url('http://www.codeblocq.com/assets/projects/hexo-theme-clean-blog/img/home-bg.jpg')">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <div class="post-heading">
                    <h1>项目bug</h1>
                    
                    <span class="meta">
                        <!-- Date and Author -->
                        
                        
                            2017-04-06
                        
                    </span>
                </div>
            </div>
        </div>
    </div>
</header>

<!-- Post Content -->
<article>
    <div class="container">
        <div class="row">

            <!-- Tags and categories -->
           

            <!-- Gallery -->
            

            <!-- Post Main Content -->
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <p>后台管理系统(后台是php)<br>1，登录问题，路由功能，首先要求登录，无论是什么url地址<br>,先登录由后台实现，隐藏index.php文件<br>跨域错误,配置反向代理httpd-vhost.conf   ProxyPass 地址<br>登录按钮是submit,点击时阻止默认跳转，<br>cookie记录用户信息  实现信息共享，（后台返回了用户头像等信息）<br>密码正确，跳转到locaton.href=’首页’<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">记录与使用cookie(以引入jquey-cookie)   </div><div class="line">$.cookie(&apos;loginInfo&apos;, JSON.stringify(data.result), &#123;path: &apos;/&apos;&#125;);</div><div class="line">  var loginInfo = $.cookie(&apos;loginInfo&apos;);</div><div class="line">console.log(loginInfo)</div><div class="line"></div><div class="line">//判断用户是否登录,只有后端判断登录状态，此时输入配置的域名可以直接访问,so</div><div class="line">var flag = $.cookie(&apos;PHPSESSID&apos;);</div><div class="line">  if (!flag &amp;&amp; location.pathname != &apos;/main/login&apos;) &#123;</div><div class="line">    location.href = &apos;/main/login&apos;;</div><div class="line">  &#125;</div></pre></td></tr></table></figure></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line">全局的ajax</div><div class="line"> //处理遮罩层</div><div class="line">  $(document).ajaxStart(function () &#123;</div><div class="line">    $(&apos;图片&apos;).show()</div><div class="line">  &#125;)</div><div class="line">  //隐藏太快了，处理一下</div><div class="line">  $(document).ajaxStop(function () &#123;</div><div class="line">    setTimeout(function () &#123;</div><div class="line">      $(&apos;图片&apos;).hide()</div><div class="line">    &#125;, 500)</div><div class="line">  &#125;)</div></pre></td></tr></table></figure>
<p>ajax是异步的，so看好关系，不是并列关系就写在成功执行中<br>bootstrop不是标准模块，使用bootstrap的js时，需引入jQuery<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">bootstrap: &#123;</div><div class="line">     deps: [&apos;jquery&apos;]</div><div class="line">   &#125;</div><div class="line"> &#125;</div></pre></td></tr></table></figure></p>
<p><img src="/img/9.bmp" alt="&#39;直接使用报错&#39;"><br>跨域错误<br><img src="/img/5.bmp" alt=""></p>
<p> WebStorm 中显示错误，但并不影响,假错误<br><img src="/img/6.bmp" alt=""></p>
<p>获取的cs_id值为空，html里没传value,只写了name<br><img src="/img/7.bmp" alt=""><br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">多个类名是startOrStop的按钮</div><div class="line"> $(&apos;.startOrStop&apos;).click(function () &#123;</div><div class="line">        var tcId = $(&apos;.startOrStop&apos;).parent(&apos;td&apos;).attr(&apos;data-id&apos;);</div><div class="line">		 alert(tcId)此时获取的不是每个按钮的tcId,仅是第一个的</div><div class="line">		 so 改为var tcId = $(this).parent(&apos;td&apos;).attr(&apos;data-id&apos;);</div></pre></td></tr></table></figure></p>
<p>由于传的参数不正确,报错如下图<br><img src="/img/8.bmp" alt=""></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">//添加时内容为空，只改变文字</div><div class="line">    var html = template(&apos;tpl&apos;, &#123;option:&apos;添加讲师&apos;&#125;);</div></pre></td></tr></table></figure>
<p>保证图片上传时的唯一性<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">var  jcrop_api = null;;// 保证裁切实例的唯一性</div><div class="line"> if(jcrop_api) jcrop_api.destroy();如果存在，销毁</div><div class="line"> </div><div class="line">  jcrop_api = this;</div></pre></td></tr></table></figure></p>


                
            </div>

            <!-- Comments -->
            
                <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                    


                </div>
            
        </div>
    </div>
</article>

    <!-- Footer -->
    <hr />

<!-- Footer -->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <ul class="list-inline text-center">
                    

                    

                    
                        <li>
                            <a href="https://github.com/klugjo/hexo-theme-clean-blog" target="_blank">
                                <span class="fa-stack fa-lg">
                                    <i class="fa fa-circle fa-stack-2x"></i>
                                    <i class="fa fa-github fa-stack-1x fa-inverse"></i>
                                </span>
                            </a>
                        </li>
                    

                    

                    

                    
                </ul>
                <p class="copyright text-muted">&copy; 2018 John Doe<br></p>
                <p class="copyright text-muted">Original Theme <a target="_blank" href="http://startbootstrap.com/template-overviews/clean-blog/">Clean Blog</a> from <a href="http://startbootstrap.com/" target="_blank">Start Bootstrap</a></p>
                <p class="copyright text-muted">Adapted for <a target="_blank" href="https://hexo.io/">Hexo</a> by <a href="http://www.codeblocq.com/" target="_blank">Jonathan Klughertz</a></p>
            </div>
        </div>
    </div>
</footer>


    <!-- After footer scripts -->
    
<!-- jQuery -->
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>

<!-- Bootstrap -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

<!-- Gallery -->
<script src="//cdnjs.cloudflare.com/ajax/libs/featherlight/1.3.5/featherlight.min.js" type="text/javascript" charset="utf-8"></script>

<!-- Disqus Comments -->



</body>

</html>